///////////////////////////////////////////////////////////
//  messagedef.h
//  Implementation of the messagedef
//  Created on:      08-Apr-2009 10:06:32 AM
//  Original author: Tim Kuo
///////////////////////////////////////////////////////////

#if !defined(EA_9F454DB8_A969_4830_9B7B_1DCC06DF5CD6__INCLUDED_)
#define EA_9F454DB8_A969_4830_9B7B_1DCC06DF5CD6__INCLUDED_

#include "common.h"

#define EventDb (2000)
#define EventNet (3000)
#define EventLocal (4000)


enum MESSAGE_TYPE {
	ACTION_COMMON = ((GROUP_COMMON | ACTION_FLAG )<<24),
	EVENT_COMMON = ((GROUP_COMMON | EVENT_FLAG )<<24),
	MESSAG_COMMON_END
};

enum MESSAGE_STAFFMGNT {
	ACTION_SF = ((GROUP_STAFFMGNT | ACTION_FLAG )<<24),
	ACTION_SF_BROWSE = ((ACTION_SF | 0x00FF0000) & ((SUBGROUP_SF_STAFFBROWSE<<16) | 0xFF000000)),
	ACTION_SF_INFOMGNT = ((ACTION_SF | 0x00FF0000) & ((SUBGROUP_SF_INFOMGNT<<16) | 0xFF000000)),
	ACTION_SF_SALARYMGNT = ((ACTION_SF | 0x00FF0000) & ((SUBGROUP_SF_SALARYMGNT<<16) | 0xFF000000)),
	ACTION_SF_PASSWORDMGNT = ((ACTION_SF |0x00FF0000) & ((SUBGROUP_SF_PASSWORDMGNT<<16) | 0xFF000000)),
	ACTION_SF_ADVANCEDMGNT = ((ACTION_SF |0x00FF0000) & ((SUBGROUP_SF_ADVANCEDMGNT<<16) | 0xFF000000)),
	EVENT_SF = ((GROUP_STAFFMGNT | EVENT_FLAG )<<24),
	MESSAGE_SF_END
};

//ACTION format: GROUP(high 8 bit) + SUBGROUP(middle 8 bit) + action id(low 16 bit)
enum ACTION{
	ACTION_SYSTEM_START = ACTION_COMMON + 1,
	ACTION_SETSUPERUSER,
	ACTION_LOGIN,
	ACTION_LOGOFF,
	ACTION_EXIT,
	ACTION_MAINMENU,
	ACTION_GETLOGGEDSTAFF,
	ACTION_STAFFMGNT = ACTION_SF + 1,
	ACTION_GEALLSTAFF,
	ACTION_GETJOBTYPE,
	ACTION_GETLEVELTYPE,
	ACTION_GETSTATUSTYPE,
	ACTION_CHANGEPASSWORD,
	ACTION_SETPICTURE,
	ACTION_GETSTAFF = ACTION_SF_BROWSE + 1,
	ACTION_GETPICTURE,
	ACTION_ADDSTAFF = ACTION_SF_INFOMGNT + 1,
	ACTION_REMOVESTAFF,
	ACTION_MODIFYSTAFF,
	ACTION_RESETPASSWORD,
	ACTION_VIEWSTAFFTASKS = ACTION_SF_SALARYMGNT +1,
	ACTION_VIEWSTAFFSALARY,
	ACTION_MODIFYSTAFFSALARY,
	ACTION_SETJOBTYPE = ACTION_SF_ADVANCEDMGNT + 1,
	ACTION_SETLEVELTYPE,
	ACTION_REMOVEJOBTYPE,
	ACTION_REMOVELEVELTYPE,
	ACTION_SETSTATUSTYPE,
	ACTION_END
};

enum EVENT{
	EVENT_SYSTEM_START = EVENT_COMMON +1,
	EVENT_INIT,
	EVENT_INIT_FINISHED,
	EVENT_WIZARD,
	EVENT_SETSUPERUSER,
	EVENT_LOGGEDIN,
	EVENT_LOGGEDOFF,
	EVENT_EXIT,
	EVENT_MAINMENU,
	EVENT_LOGGEDSTAFF,

	EVENT_STAFFMGNT = EVENT_SF + 1,
	EVENT_ALLSTAFF,
	EVENT_JOBTYPE,
	EVENT_LEVELTYPE,
	EVENT_STATUSTYPE,
	EVENT_CHANGEPASSWORD,
	EVENT_SETPICTURE,
	EVENT_STAFF,
	EVENT_GETPICTURE,
	EVENT_STAFFADDED,
	EVENT_STAFFREMOVED,
	EVENT_STAFFMODIFIED,
	EVENT_RESETPASSWORD,
	EVENT_VIEWSTAFFTASKS,
	EVENT_VIEWSTAFFSALARY,
	EVENT_MODIFYSTAFFSALARY,
	EVENT_SETJOBTYPE,
	EVENT_SETLEVELTYPE,
	EVENT_REMOVEJOBTYPE,
	EVENT_REMOVELEVELTYPE,
	EVENT_SETSTATUSTYPE,
	EVENT_STAFFMGNT_END,

	EVENT_END
};

#endif // !defined(EA_9F454DB8_A969_4830_9B7B_1DCC06DF5CD6__INCLUDED_)
